
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page import="java.util.HashMap"%>
<HTML xmlns:epro>
<%@ taglib uri="/WEB-INF/HeadTag.tld" prefix="head"%>
<%@ taglib uri="/WEB-INF/ToolbarTag.tld" prefix="toolbar"%>
<%@ taglib uri="/WEB-INF/ErrorTag.tld" prefix="error"%>
<head:Head 
     title="Modify Case"  
	styleFile	="../theme/defaultTheme.css"
	import		="toolbar"
	jsFile			="../script/imgProp.js,../script/Alert.js,../script/checkValidData.js,../script/lov.js" 
></head:Head>
<!--style type="stylesheet">
.disableFont
{	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size:11px;
	font-weight:bold;
	text-align:right;
	color:gray;
}

.enableFont{
	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size:11px;
	font-weight:bold;
	text-align:right;
	color:red;
}
</style-->
<%@ page 
     import="java.util.Vector,
          com.softplus.carrefour.hd.bltier.admin.CFHDModuleManage,
          com.softplus.carrefour.hd.CFHDSystem,
          com.softplus.carrefour.hd.bltier.admin.CFHDSystemManage,
          com.softplus.carrefour.hd.bltier.admin.CFHDModuleManage,
          com.softplus.carrefour.hd.bltier.admin.CFHDEnvironmentManage,
          com.softplus.carrefour.hd.bltier.entity.CfhdCaseDetail,
          com.softplus.carrefour.hd.bltier.admin.CFHDErrorTypeManage,
          com.softplus.carrefour.hd.bltier.entity.UserLevel,
          com.softplus.carrefour.hd.bltier.entity.CfhdCaseHead,
          com.softplus.carrefour.hd.bltier.admin.UserLevelManage,
          com.softplus.carrefour.hd.bltier.pc.ICaseHeadViewer,
          com.softplus.carrefour.hd.bltier.*,
          com.softplus.carrefour.hd.bltier.pc.*,
          com.epro.standard.frontend.util.ShowData,
          com.softplus.carrefour.hd.bltier.entity.*,
           java.math.BigDecimal,
           java.text.SimpleDateFormat,
           com.softplus.carrefour.hd.bltier.admin.RoutePathManage"
%>
<%	 
System.out.println("====page update ======*****************************@@@@@@@@@@@@@@");   
    //-----------------------------------------------

	String caseID = request.getParameter("caseID") == null ? "" : request.getParameter("caseID");		
	String check = request.getParameter("check") == null ? "" : request.getParameter("check");		
	String submitSuccess = request.getParameter("submitSuccess") == null ? "" : request.getParameter("submitSuccess");		
	String seqDetail = request.getParameter("seqDetail") == null ? "0" : request.getParameter("seqDetail");	
	System.out.println("===submitSuccess======"+submitSuccess); 
	if(submitSuccess.equals("true"))
	{
 		out.print("<script>");
  		//out.print("dialogArguments.location=dialogArguments.location;");	
  		out.print("dialogArguments.frm.checkUnload.value='false';") ;	
 		out.print("dialogArguments.location.href=\"CFHDPCMT06.jsp?caseno=");
 		out.print(caseID); 		
 	 	//out.print("&projectID="); 	
 		//out.print(projectID); 
 		//out.print("&subModule="); 	
 		//out.print(subModuleMT); 		
 		out.print("\";"); 	
 		out.print("window.close();");
 		out.print("</script>");
	}else{
						if(submitSuccess.equals("false"))
					{
				 		out.print("<script>");
				 		//out.print("dialogArguments.location=dialogArguments.location;");		
				 		out.print("dialogArguments.frm.checkUnload.value='false';") ;
				 		out.print("dialogArguments.location.href=\"CFHDPCMT07.jsp?caseID=");
				 		out.print(caseID); 		
				 	 	out.print("&checkunload=false"); 	
				 		//out.print(projectID); 
				 		//out.print("&subModule="); 	
				 		//out.print(subModuleMT); 		
				 		out.print("\";"); 	
				 		out.print("window.close();");
				 		out.print("</script>");
					}
	}
		String tableWidth			= "640";
		String tableWidth1		= "660";
		String labelColWidth	= "300";
		String inputColWidth	= "170";
		String longBoxWidth	= "490";
		String longBoxWidth1	= "480";
		String shortBoxWidth	= "160";
		String buttonWidth		= "50";

	ShowData showData 	= new ShowData();		
	String current=new SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date());

	 System.out.println("=====caseID in CFHDPCUP07.jsp====="+caseID);   


//-----------Case Head------------------------------------------
  ICaseHeadViewer  caseheadManage  = (CCaseHeadManage)CFHDSystem.getControlClass("CASE_HEAD");
  CfhdCaseHead        caseheadEntity  =   caseheadManage.getCaseHeadDesc(caseID);

          String system ="";
          String module ="";
          String aldataNo ="";
          String goldVer ="";
          String environment ="";
          String screenName ="";
          String reportedBy ="";
          String dwNumber ="";
          
           if(caseheadEntity!=null)
           {
                system 			= caseheadEntity.getCfhdSystem()==null?"":caseheadEntity.getCfhdSystem();
                
                module			= caseheadEntity.getCfhdModule()==null?"":caseheadEntity.getCfhdModule();
                
                aldataNo		= caseheadEntity.getAlDataNo()==null?"":caseheadEntity.getAlDataNo();
                
                goldVer			= caseheadEntity.getGoldVersion()==null?"":caseheadEntity.getGoldVersion();
                
                environment	= caseheadEntity.getCfhdEnvironment()==null?"":caseheadEntity.getCfhdEnvironment();
                
                screenName	=caseheadEntity.getScreenName()==null?"":caseheadEntity.getScreenName();
                
                reportedBy	=caseheadEntity.getReportedBy()==null?"":caseheadEntity.getReportedBy();
                
                dwNumber	=caseheadEntity.getDwNumber()==null?"":caseheadEntity.getDwNumber();
                               
                System.out.println(dwNumber+"********dwNumber********"+reportedBy);
          }

//-----------Detail-----------------------------------------
      ICaseDetailViewer  casedetailManage  = ( CCaseDetailManage)CFHDSystem.getControlClass("CASE_DETAIL");

     
     //------getCaseDetailbyCaseHead----------------
          Vector           vectorCaseDetailbyCaseHead  =   casedetailManage.getCaseDetailbyCaseHead(caseID);
           int  vectorDetialSize =   vectorCaseDetailbyCaseHead.size();

     
     CfhdCaseDetail           casedetailEntity  =   casedetailManage.getCaseDetailDesc(new CfhdCaseDetailPK(caseID,new BigDecimal(vectorDetialSize-1)));     
     System.out.println("====================vectorCaseDetailbyCaseHead.size()="+vectorDetialSize+"=="+(vectorDetialSize-1));    
     int   DetialSize  = vectorDetialSize-1;

          String actionSelect ="";
          String caseType ="";
          String caseTypeDetail ="";
          String caseTypeHead ="";
          String caseTypeDes ="";
          Integer  severity = null;
          Integer  severityHead = null;
          String severityDes ="";
          String ownerName ="";
           String ownerSurname ="";
          String transferTo ="";
          String touserLevel ="";
          String typeofError ="";
          String detail ="";
          String userID="";
          String levelUser="";
          java.util.Date dateToApply=new java.util.Date();
          UserLevelManage  userManage =new UserLevelManage();          

           if(casedetailEntity!=null)
           {
                actionSelect		= casedetailEntity.getCaseAction()==null?"":casedetailEntity.getCaseAction();
                
              	caseType  =caseheadEntity.getCaseType()==null?"":caseheadEntity.getCaseType();
                
                caseTypeDetail  =casedetailEntity.getCaseDetType()==null?caseType:casedetailEntity.getCaseDetType();
                
                dateToApply  =casedetailEntity.getDateToApply()==null?dateToApply:casedetailEntity.getDateToApply();
                
                caseTypeHead = caseheadEntity.getCaseType()==null?"":caseheadEntity.getCaseType();
                
                caseTypeDes  =CfhdCaseHead.getCaseTypeDesc(caseTypeHead)==null?"":CfhdCaseHead.getCaseTypeDesc(caseTypeHead);
               
               severityHead = caseheadEntity.getSeverity()==null?new Integer(1): caseheadEntity.getSeverity();
               
               severityDes = CfhdCaseHead.getServerityDesc(caseheadEntity.getSeverity().toString())==null?"":CfhdCaseHead.getServerityDesc(caseheadEntity.getSeverity().toString());
               
                severity  =casedetailEntity.getCaseDetServerity()==null?caseheadEntity.getSeverity():casedetailEntity.getCaseDetServerity();
               
                 levelUser =userManage.getUserLevelByUserID(casedetailEntity.getUserId());
                 userID =casedetailEntity.getUserId();
              
                UserLevel  owner =   (UserLevel)userManage.getUserLevel(casedetailEntity.getUserId());
                ownerName = owner.getUserAccount().getUserName()==null?"":owner.getUserAccount().getUserName();
                ownerSurname = owner.getUserAccount().getUserSurname()==null?"":owner.getUserAccount().getUserSurname();
               ownerName = ownerName+" "+ownerSurname;
               
                transferTo    = casedetailEntity.getTransferTo()==null?"":casedetailEntity.getTransferTo();
               
               // touserLevel =  UserLevel.getLevelName(casedetailEntity.getTransferToLv())==null?"":UserLevel.getLevelName(casedetailEntity.getTransferToLv());
                touserLevel =  casedetailEntity.getTransferToLv()==null?"":casedetailEntity.getTransferToLv();
               
                typeofError =  casedetailEntity.getCfhdErrType()==null?"":casedetailEntity.getCfhdErrType();
                detail = casedetailEntity.getDetDesc()==null?"":casedetailEntity.getDetDesc();
          }

if(actionSelect.equals(""))
{
actionSelect=CfhdCaseDetail.ACTION_ANSWER;//"ANS";
}

//if((caseTypeHead.equals(CfhdCaseHead.CASE_CHANGE_REQUEST))&&(levelUser.equals("L2Z")||levelUser.equals("L3BKK")||levelUser.equals("PROD"))  )
//{
//	actionSelect=CfhdCaseDetail.ACTION_REJECT ;
//}



//-----------Attachment  Description----------------------------------------
     ICaseDocViewer  	casedocManage  = (CCaseDocManage)CFHDSystem.getControlClass("CASE_DOC");
    CfhdCaseDoc           casedocEntity  	  =   casedocManage.getCaseDocByPK(new CfhdCaseDocPK(caseID,new BigDecimal(DetialSize),new BigDecimal(0) )); 
 String attachment ="";
 String description =""; 

          if(casedocEntity!=null)
		 { 	
 
				try{
					     if((casedocEntity!=null) &&(casedocEntity.getAttFileName()!=null))
					     {
								attachment = java.net.URLDecoder.decode(casedocEntity.getAttFileName());
								System.out.println("=====^^^^^^^^^^^^^^^^attachment^^^^^^^^^^^^^^^"+attachment);       
						}
					}catch(java.lang.IllegalArgumentException e)
					{
					attachment=casedocEntity.getAttFileName() ;
					System.out.println("=====^^^^^^^^^error error error^^^^^^^^^"+attachment);     
					}
					
               // attachment = casedocEntity.getAttFileName()==null?"":casedocEntity.getAttFileName();
                description =	casedocEntity.getAttDesc()==null?"":casedocEntity.getAttDesc();
		 }

          CFHDSystemManage              chsm 	=(CFHDSystemManage)CFHDSystem.getControlClass("SYSTEM");
          CFHDModuleManage              chmm 	= (CFHDModuleManage)CFHDSystem.getControlClass("MODULE");
          CFHDEnvironmentManage    chem       =(CFHDEnvironmentManage)CFHDSystem.getControlClass("ENVIRONMENT");
          CFHDErrorTypeManage          chtm      	=(CFHDErrorTypeManage)CFHDSystem.getControlClass("ERROR_TYPE");
          HashMap ulevelMap = UserLevel.uLevel;
%>
<BODY onload=" if('<%=system%>'!=''){limitModule();}if('<%=actionSelect%>'!=''){showDataFirst('','<%=actionSelect%>');}if('<%=check%>'=='true'){showProgramLayer();}" >
     <div id="processingLayer" style="visibility:hidden; position:absolute; left:50px; top:150px;">
          <IMG alt="Waiting..." SRC="../images/background/Processing.gif" WIDTH="585" HEIGHT="136" BORDER="0">
     </div>
<FORM name="updateForm" enctype="multipart/form-data" action="../servlet/com.softplus.carrefour.hd.frontend.servlet.process.CFHDPC07" method="post" onsubmit="submitForm(); return false;" target="chkUpload">
     <div style="width:100%;height:90%;margin:5px" id="programLayer">
<INPUT name="caseID" type="hidden" value="<%=caseID%>">
<INPUT name="action" type="hidden" >
<INPUT name="seqDetail" type="hidden" value="<%=DetialSize%>" >

<TABLE width="<%=tableWidth1%>" >
<TR>
<TD>
<IMG src='../images/icon/toolbar/nSubmit.gif' alt='Submit' onclick="requireField('submit');" style='cursor: hand' 
onmouseover="this.src='../images/icon/toolbar/oSubmit.gif'" onmouseout="this.src='../images/icon/toolbar/nSubmit.gif'">
<toolbar:toolbar  typeAs="save" onclick="requireField('save');"></toolbar:toolbar>
<toolbar:toolbar typeAs="EXIT" ></toolbar:toolbar>
</TD>
</TR>
</TABLE>
<!--Start *************************************************************** Modify Case Information   *************************************************************** --->
<FIELDSET style="width:<%=tableWidth%>;margin-left: 5px;">
<TABLE style="width:<%=tableWidth%>;">
<TR><TD class="titleFont"><FONT color="red" >* required field</FONT></TD></TR>
</TABLE>

<FIELDSET style="width:<%=tableWidth%> ">
<LEGEND class="titleFont">Modify Case Information</LEGEND>
<%if(!reportedBy.equals("")){ %>
<div class="titleFont" style="margin-top: 5px">
 	<FONT color="red">*</FONT> Reported By : 
<SELECT name="rptBy" style="width: 180">
<OPTION  <%if(reportedBy.equals(UserLevel.LEVEL_2_AMS_ZONE_ASIA)){ %> selected="selected"  <%} %>
	value="<%=UserLevel.LEVEL_2_AMS_ZONE_ASIA%>"><%=ulevelMap.get(UserLevel.LEVEL_2_AMS_ZONE_ASIA).toString()%></OPTION>
<OPTION  <%if(reportedBy.equals(UserLevel.LEVEL_3_ZONE_DATA_CENTER)){ %> selected="selected"  <%} %>
	value="<%=UserLevel.LEVEL_3_ZONE_DATA_CENTER%>"><%=ulevelMap.get(UserLevel.LEVEL_3_ZONE_DATA_CENTER).toString()%></OPTION>
</SELECT>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<FONT color="red">*</FONT> DW Number :
	<INPUT type="text" style="width: <%=shortBoxWidth%>" name="DWNumber" maxlength="12" value="<%=dwNumber %>">
</div>
<%} %>
<TABLE width="<%=tableWidth%>" >
	<TR>
<!-- //////**********************System  ************************////--->
		<TD class="titleFont" width="10%<%//=labelColWidth%>"><FONT class="titleFont" color="red">*</FONT>System :</TD>
		<TD width="<%=inputColWidth%>">
		<SELECT name="system"  style="width: <%=shortBoxWidth%>" onchange="limitModule()">
	<OPTION  value="">- -Please Select- -</OPTION>	
	<%
	 Vector showValue1 = null;   
	showValue1 =chsm.getListSystem();
	 for(int i=0;i<showValue1.size();i++){ 
	%>
	<option value="<%=showValue1.elementAt(i)%>" label="" title="" 
	<%if(system.equals((String)showValue1.elementAt(i))){%>selected="selected"<%}%>>
	<%=(String)showValue1.elementAt(i)%></option>
	<%	
	} 
	%>
		</SELECT>   
		</TD>

<!-- //////**********************Module ************************////--->		
		<TD class="titleFont" width="29%<%//=labelColWidth%>"><FONT class="titleFont" color="red">*</FONT>Module : </TD>
		<TD width="<%=inputColWidth%>">
		<SELECT name="module"  style="width: <%=shortBoxWidth%>" >
							<% 
							 Vector showValue2 = null;   
							showValue2 =chmm.getListModule();
							String	wholeModule="";
							if(showValue2.size()>0){
								wholeModule =	"'"+(String)showValue2.elementAt(0)+"'";
								}						
							for (int i=0;i<showValue2.size();i++){
									if (i<(showValue2.size()-1)){
											wholeModule	=	wholeModule+",'"+showValue2.elementAt(i+1)+"'";
									}
							}//end for systemVector
							 %>
		<OPTION  value="">- -Please Select- -</OPTION>
		</SELECT> 
		</TD>
		
<!-- //////**********************Aldata Internal No.  ************************////--->		
	</TR>
	<TR>
		<TD class="titleFont" width="10%<%//=labelColWidth%>"><!--FONT id="fontAldataNo" >*</FONT-->Aldata Internal No. : </TD>
		<TD colspan="3" width="<%=inputColWidth%>">
		<INPUT type="text" style="width: <%=longBoxWidth1%>" name="aldataNo" value="<%=showData.CheckNull(aldataNo)%>" maxlength="250"></TD>
	</TR>
	<TR>
	
<!-- //////**********************GOLD Version ************************////--->		
		<TD class="titleFont" width="10%<%//=labelColWidth%>"><FONT id="fontGoldVersion" >*</FONT>GOLD Version : </TD>
		<TD width="<%=inputColWidth%>"><INPUT type="text" name="goldVersion" style="width: <%=shortBoxWidth%>" value="<%=showData.CheckNull(goldVer)%>" maxlength="250"></TD>
		
<!-- //////**********************Environment************************////--->	
		<TD class="titleFont" width="<%//=labelColWidth%>"><FONT id="fontEnvironment" >*</FONT>Environment : </TD>
		<TD width="<%=inputColWidth%>">
		<SELECT name="environment"  style="width: <%=shortBoxWidth%>">
		<OPTION  value="">- -Please Select- -</OPTION>
			<% 
			Vector showValue3 = null;
			showValue3 =chem.getListEnvironment();
			 for(int i=0;i<showValue3.size();i++){ 
			%>
			<option value="<%=(String)showValue3.elementAt(i)%>" label="" title=""  <%if(environment.equals((String)showValue3.elementAt(i))){%>selected="selected"<%}%>>
			<%=(String)showValue3.elementAt(i)%></option>
			<%	
			} 
			%>
		</SELECT>
		</TD>
	</TR>
	
<!-- //////**********************Screen Name************************////--->	
	<TR>
		<TD class="titleFont" width="29%<%//=labelColWidth%>">Screen Name : </TD>
		<TD colspan="3" width="<%=inputColWidth%>">
		<INPUT type="text" style="width: <%=longBoxWidth1%>" name="screenName" value="<%=showData.CheckNull(screenName)%>" maxlength="250">
		</TD>
	</TR>
</TABLE>
</FIELDSET>
<!--End *************************************************************** Modify Case Information   *************************************************************** --->

<!--Start *************************************************************** Case Solution*************************************************************** --->
<FIELDSET style="width:<%=tableWidth%> ">
<LEGEND class="titleFont">Case Solution</LEGEND>
<TABLE width="<%=tableWidth%>" >
	<TR>
	
<!-- //////**********************Select Action************************////--->
		<TD class="titleFont" width="22%<%//=labelColWidth%>">Select Action :</TD>
		<TD width="<%=inputColWidth%>">
		<%
			Vector showAction = null;
			showAction =userManage.getUserActionByUserID(caseType,userID);
			System.out.println("+++1=caseType"+caseType);
			System.out.println("+++1=userID"+userID);
			System.out.println("+++1=showAction"+showAction.size());
			String tempAct ="";
			if(showAction.size()>0)
			{
		%>
		<SELECT name="selectAction"  style="width: <%=shortBoxWidth%>"  onchange="showData(this,'');" >
		<% 
			 for(int i=0;i<showAction.size();i++){ 
					 tempAct = (String)showAction.elementAt(i);
		%>
					<option value="<%=tempAct%>" label="" title=""  <%if(actionSelect.equals(tempAct)){%>selected="selected"<%}%>>
					<%=CfhdCaseDetail.getDetailDesc(tempAct)%></option>
					<%	} %>
		<!--OPTION  value="<%//=CfhdCaseDetail.ACTION_ANSWER%>"   <%//if(actionSelect.equals(CfhdCaseDetail.ACTION_ANSWER)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseDetail.getDetailDesc(CfhdCaseDetail.ACTION_ANSWER)%></OPTION>
		<OPTION  value="<%//=CfhdCaseDetail.ACTION_MANUAL_ESCALATE%>"  <%//if(actionSelect.equals(CfhdCaseDetail.ACTION_MANUAL_ESCALATE)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseDetail.getDetailDesc(CfhdCaseDetail.ACTION_MANUAL_ESCALATE)%></OPTION>  
		<OPTION  value="<%//=CfhdCaseDetail.ACTION_REJECT%>"   <%//if(actionSelect.equals(CfhdCaseDetail.ACTION_REJECT)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseDetail.getDetailDesc(CfhdCaseDetail.ACTION_REJECT)%></OPTION>  
		<OPTION  value="<%//=CfhdCaseDetail.ACTION_TRANSFER%>"  <%//if(actionSelect.equals(CfhdCaseDetail.ACTION_TRANSFER)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseDetail.getDetailDesc(CfhdCaseDetail.ACTION_TRANSFER)%></OPTION>  
		<OPTION  value="<%//=CfhdCaseDetail.ACTION_REQUALIFY%>" <%//if(actionSelect.equals(CfhdCaseDetail.ACTION_REQUALIFY)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseDetail.getDetailDesc(CfhdCaseDetail.ACTION_REQUALIFY)%></OPTION>  
		<OPTION  value="<%//=CfhdCaseDetail.ACTION_CHANGE_SERVERITY%>"  <%//if(actionSelect.equals(CfhdCaseDetail.ACTION_CHANGE_SERVERITY)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseDetail.getDetailDesc(CfhdCaseDetail.ACTION_CHANGE_SERVERITY)%></OPTION-->  
		</SELECT>   
		<%}else{%>
		<SELECT name="selectAction"  style="width: <%=shortBoxWidth%>" disabled="disabled">
		<%}%>		
		</TD>
	</TR>
	<TR>
			<%
			System.out.println("+++2=caseType"+caseType);
			System.out.println("+++2=userID"+userID);
			System.out.println("+++2=showAction"+showAction.size());

		%>
<!-- //////**********************Case Type************************////--->
		<TD class="titleFont" width="<%=labelColWidth%>">Case Type : </TD>
		<TD width="<%=inputColWidth%>">
		<INPUT type="text" style="width: <%=shortBoxWidth%>" name="caseType" class="disabledTxtField" readonly="readonly" value="<%=showData.CheckNull(caseTypeDes)%>">
		</TD>

<!-- //////**********************Severity************************////--->
		<TD class="titleFont" width="<%=labelColWidth%>">Severity : </TD>
		<TD width="<%=inputColWidth%>">
		<INPUT type="text" style="width: <%=shortBoxWidth%>" name="severity" class="disabledTxtField" readonly="readonly" value="<%=showData.CheckNull(severityDes)%>">
		</TD>
	</TR>
	<TR>
	
<!-- //////**********************Requalify Type To************************////--->	
<%if(!caseTypeHead.equals(CfhdCaseHead.CASE_SERVICE_REQUEST)){ %>
		<TD class="titleFont" width="<%=labelColWidth%>" >
		<LABEL id="labelrequalifyTo"  class="disableFont"><FONT id="fontrequalifyTo" >*</FONT>Requalify Type To :</LABEL>
		</TD>
		<TD width="<%=inputColWidth%>">
		<SELECT name="requalifyTo"  style="width: <%=shortBoxWidth%>" disabled="disabled">
		 <%if(caseTypeHead.equals(CfhdCaseHead.CASE_USER_QUESTION)){%>		
		<OPTION  value="<%=CfhdCaseHead.CASE_PROBLEM_REPORT%>" <%if(caseTypeDetail.equals(CfhdCaseHead.CASE_PROBLEM_REPORT)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_PROBLEM_REPORT)%></OPTION>  
		<OPTION  value="<%=CfhdCaseHead.CASE_CHANGE_REQUEST%>" <%if(caseTypeDetail.equals(CfhdCaseHead.CASE_CHANGE_REQUEST)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_CHANGE_REQUEST)%></OPTION>  
		<%}else%>
		 <%if(caseTypeHead.equals(CfhdCaseHead.CASE_PROBLEM_REPORT)){%>
		<!--OPTION  value="<%//=CfhdCaseHead.CASE_USER_QUESTION%>" <%//if(caseTypeDetail.equals(CfhdCaseHead.CASE_USER_QUESTION)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_USER_QUESTION)%></OPTION-->
		<OPTION  value="<%=CfhdCaseHead.CASE_CHANGE_REQUEST%>" <%if(caseTypeDetail.equals(CfhdCaseHead.CASE_CHANGE_REQUEST)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_CHANGE_REQUEST)%></OPTION>  
		<%}else%>
		 <%if(caseTypeHead.equals(CfhdCaseHead.CASE_CHANGE_REQUEST)){%>
		<!--OPTION  value="<%//=CfhdCaseHead.CASE_USER_QUESTION%>" <%//if(caseTypeDetail.equals(CfhdCaseHead.CASE_USER_QUESTION)){%>selected="selected"<%//}%>> 
		<%//=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_USER_QUESTION)%></OPTION-->
		<OPTION  value="<%=CfhdCaseHead.CASE_PROBLEM_REPORT%>" <%if(caseTypeDetail.equals(CfhdCaseHead.CASE_PROBLEM_REPORT)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_PROBLEM_REPORT)%></OPTION>  
		<%}%>
		
		<!--OPTION  value="<%//=CfhdCaseHead.CASE_USER_QUESTION%>" <%//if(caseTypeDetail.equals(CfhdCaseHead.CASE_USER_QUESTION)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_USER_QUESTION)%></OPTION>
		<OPTION  value="<%//=CfhdCaseHead.CASE_PROBLEM_REPORT%>" <%//if(caseTypeDetail.equals(CfhdCaseHead.CASE_PROBLEM_REPORT)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_PROBLEM_REPORT)%></OPTION>  
		<OPTION  value="<%//=CfhdCaseHead.CASE_CHANGE_REQUEST%>" <%//if(caseTypeDetail.equals(CfhdCaseHead.CASE_CHANGE_REQUEST)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseHead.getServerityDesc(CfhdCaseHead.CASE_CHANGE_REQUEST)%></OPTION-->  
		
		</SELECT>  
		 </TD>
<%}else{ %>	
<TD class="titleFont" width="<%=labelColWidth%>">Date To Apply : </TD>
<td width="<%=inputColWidth%>">
<input type="hidden" id="labelrequalifyTo">
<input type="hidden" id="fontrequalifyTo">
<input type="hidden" id="requalifyTo">
<INPUT type="text" style="width: <%=shortBoxWidth%>" name="DateToApply" class="disabledTxtField" readonly="readonly" value="<%=new SimpleDateFormat("dd/MM/yyyy").format(dateToApply)%>">
</td>
<%} %>	
<!-- //////**********************Change Severity To************************////--->		 
		<TD class="titleFont" width="<%=labelColWidth%>" >
		<LABEL id="labelchangeTo"  class="disableFont"><FONT id="fontchangeTo" >*</FONT>Change Severity To : </LABEL>
		</TD>
		<TD width="<%=inputColWidth%>">
		<SELECT name="changeTo"  style="width: <%=shortBoxWidth%>" disabled="disabled">

		 <%if(severityHead.equals(CfhdCaseHead.SERVERITY_CRITICAL)){%>
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_URGENT%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_URGENT)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_URGENT)%></OPTION>  
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_STANDARD%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_STANDARD)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_STANDARD)%></OPTION>  
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_LOW%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_LOW)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_LOW)%></OPTION>  
		<%}else%>

		 <%if(severityHead.equals(CfhdCaseHead.SERVERITY_URGENT)){%>
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_CRITICAL%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_CRITICAL)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_CRITICAL)%></OPTION>
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_STANDARD%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_STANDARD)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_STANDARD)%></OPTION>  
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_LOW%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_LOW)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_LOW)%></OPTION>  
		<%}else%>

		 <%if(severityHead.equals(CfhdCaseHead.SERVERITY_STANDARD)){%>		
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_CRITICAL%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_CRITICAL)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_CRITICAL)%></OPTION>
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_URGENT%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_URGENT)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_URGENT)%></OPTION>  
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_LOW%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_LOW)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_LOW)%></OPTION>  
		<%}else%>
		
		 <%if(severityHead.equals(CfhdCaseHead.SERVERITY_LOW)){%>		
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_CRITICAL%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_CRITICAL)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_CRITICAL)%></OPTION>
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_URGENT%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_URGENT)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_URGENT)%></OPTION>  
		<OPTION  value="<%=""+CfhdCaseHead.SERVERITY_STANDARD%>" <%if(severity.equals(CfhdCaseHead.SERVERITY_STANDARD)){%>selected="selected"<%}%>>
		<%=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_STANDARD)%></OPTION>  						
		<%}%>
		<!--OPTION  value="<%//=""+CfhdCaseHead.SERVERITY_CRITICAL%>" <%//if(severity.equals(CfhdCaseHead.SERVERITY_CRITICAL)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_CRITICAL)%></OPTION>
		<OPTION  value="<%//=""+CfhdCaseHead.SERVERITY_URGENT%>" <%//if(severity.equals(CfhdCaseHead.SERVERITY_URGENT)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_URGENT)%></OPTION>  
		<OPTION  value="<%//=""+CfhdCaseHead.SERVERITY_STANDARD%>" <%//if(severity.equals(CfhdCaseHead.SERVERITY_STANDARD)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_STANDARD)%></OPTION>  
		<OPTION  value="<%//=""+CfhdCaseHead.SERVERITY_LOW%>" <%//if(severity.equals(CfhdCaseHead.SERVERITY_LOW)){%>selected="selected"<%//}%>>
		<%//=CfhdCaseHead.getServerityDesc(""+CfhdCaseHead.SERVERITY_LOW)%></OPTION-->  

		</SELECT> 
		</TD>
	</TR>
	<TR>
	
<!-- //////**********************Ower Name************************////--->	
		<TD class="titleFont" width="<%=labelColWidth%>"> Ower Name : </TD>
		<TD colspan="3" width="<%=inputColWidth%>">
		<INPUT type="text" style="width: <%=longBoxWidth%>" class="disabledTxtField" readonly="readonly" value="<%=showData.CheckNull(ownerName)%>" name="owerName">
		</TD>
	</TR>
	<TR>
	
<!-- //////**********************Transfer To************************////--->	
		<TD class="titleFont" width="<%=labelColWidth%>" >
		<LABEL id="labeltransferTo"  class="disableFont"><FONT id="fonttransferTo" >*</FONT>Transfer To : </LABEL></TD>
		<TD colspan="3" width="<%=inputColWidth%>">
		<SELECT style="width: <%=longBoxWidth%>" name="transferTo" disabled="disabled">
		<OPTION  value="">- -Please Select- -</OPTION>
		<%
			Vector userLevel = new Vector();   
			UserLevelManage ulm      	=(UserLevelManage)CFHDSystem.getControlClass("USER_LEVEL");
  			userLevel = ulm.getTransferUser(userID);
 			
			 for(int i=0;i<userLevel.size();i++){ 
			 UserLevel ulEntity = (UserLevel) userLevel.elementAt(i);
			%>
			<option value="<%=ulEntity.getUserAccount().getUserId()%>" <%if(transferTo.equals(ulEntity.getUserAccount().getUserId())){%>selected="selected"<%}%> >
			<%=ulEntity.getUserAccount().getUserName()==null?"":ulEntity.getUserAccount().getUserName()%> <%=ulEntity.getUserAccount().getUserSurname()==null?"":ulEntity.getUserAccount().getUserSurname()%></option>
			<%	
			} %>
		</SELECT> 
		</TD>
	</TR>
	<TR>
<!-- //////**********************To User Level************************////--->
		<TD class="titleFont" width="<%=labelColWidth%>" >
		<LABEL id="labelUserLevel" ><FONT id="fontUserLevel" class="enableFont">*</FONT> To User Level : </LABEL>
		</TD>
<%

      	Vector checkLevel =new Vector();
		RoutePathManage routePath = new RoutePathManage();

		if(!reportedBy.equals("")&& (levelUser.equals(UserLevel.LEVEL_2_AMS_ZONE_ASIA))){
			
			checkLevel =   routePath.getToUserLevelForL2Z(caseType,levelUser,actionSelect);
		}else{
			checkLevel =   routePath.getToUserLevelForCase(caseType,levelUser,actionSelect);
		}
		
%>
		<TD colspan="3" width="<%=inputColWidth%>">
		<SELECT style="width: <%=longBoxWidth%>" name="toUserLevel" id="toUserLevel">
		<OPTION  value="">- -Please Select- -</OPTION>
<%		String checkSuc =""; 
			 for(int i=0;i<checkLevel.size();i++){ 
			 checkSuc = (String)checkLevel.elementAt(i);
			 System.out.println("checkSuc=="+checkSuc);
			 System.out.println("touserLevel=="+touserLevel);
			 System.out.println("actionSelect=="+actionSelect);
			%>
			<option value="<%=checkSuc%>" <%if(touserLevel.equals(checkSuc)){ System.out.println("*****Same==");%>selected="selected"<%}%> >
			<%=UserLevel.getLevelName(checkSuc)%></option>
<%	
			} 
%>

		</SELECT>
		 </TD>
	</TR>
	<TR>
	<TR>
	
<!-- //////**********************Type of Error************************////--->
		<TD class="titleFont" width="<%=labelColWidth%>" >
		<LABEL id="labeltypeofError" ><FONT id="fonttypeofError" class="enableFont">*</FONT>Type of Error : </LABEL>
		</TD>
		<TD colspan="3" width="<%=inputColWidth%>">
		<SELECT style="width: <%=longBoxWidth%>" name="typeofError" >
		<OPTION  value="">- -Please Select- -</OPTION>
			<% 
			Vector showValue4 = null;
			showValue4 =chtm.getListErrorType();
			 for(int i=0;i<showValue4.size();i++){ 
			%>
			<option value="<%=(String)showValue4.elementAt(i)%>" label="" title=""  <%if(typeofError.equals((String)showValue4.elementAt(i))){%>selected="selected"<%}%>>
			<%=(String)showValue4.elementAt(i)%></option>
			<%	
			} 
			%>
		</SELECT> 
		</TD>
	</TR>
<!-- //////**********************Detail************************////--->
	<TR>
		<TD class="titleFont" width="<%=labelColWidth%>">Detail : </TD>
		<TD colspan="3">
		<TEXTAREA rows="4" cols="10" style="width: <%=longBoxWidth%>" name="detail"><%=detail%></TEXTAREA></TD>
	</TR>

<!-- //////**********************File Attachment************************////--->
	<TR>
		<TD class="titleFont" width="<%=labelColWidth%>"> Attachmented : </TD>
		<TD colspan="3" >
		<!--INPUT type="text" style="width: <%=longBoxWidth%>" value="<%//= showData.CheckNull(attachment)%>" name="attachment"-->
		<INPUT type="text" name="old_file" style="width: 460" value="<%=showData.CheckNull(attachment)%>" readonly="readonly" class="disabledTxtField">
		<IMG src='../images/icon/toolbar/nDelete.gif' alt='Delete Attachment'
		onclick="if(updateForm.old_file.value!='') if(showOConfirmDialog('Clear Data', 'Do you want to clear data?', 'OK.', 'Cancel') == 1){updateForm.old_file.value='';}"
		style='cursor: hand' 	onmouseover="this.src='../images/icon/toolbar/oDelete.gif'" onmouseout="this.src='../images/icon/toolbar/nDelete.gif'">
		</TD>
	</TR>
	
<!-- //////**********************Attachment************************////--->
	<TR>
		<TD class="titleFont" width="<%=labelColWidth%>">Attachment : </TD>
		<TD colspan="3" width="<%=inputColWidth%>">
		<!--INPUT type="text" style="width: <%=longBoxWidth%>" value="<%//= showData.CheckNull(attachment)%>" name="attachment"-->
			<INPUT type="file" name="ATT_FILE" style="width: <%=longBoxWidth%>"  onchange="checkExts();"  id="fileName" >
		</TD>
	</TR>
	
	
	<TR>
		<TD></TD>
		<TD colspan="3" class="titleFont" style="text-align: left;">
			<FONT color="red">** Can attach only one file and Max. File Size = 512KB</FONT>

	</TR>
	
<!-- //////**********************Description************************////--->
	<TR>
		<TD class="titleFont" width="<%=labelColWidth%>">Description : </TD>
		<TD colspan="3"><TEXTAREA rows="2" cols="10" style="width: <%=longBoxWidth%>" name="description"><%=showData.CheckNull(description)%></TEXTAREA></TD>
	</TR>
	
<!-- //////**********************Update Date************************////--->
	<TR>
		<TD class="titleFont" width="<%=labelColWidth%>">Update Date : </TD>
		<TD colspan="3" width="<%=inputColWidth%>">
		<INPUT type="text" style="width: <%=longBoxWidth%>" name="updateDate" class="disabledTxtField" readonly="readonly" value="<%=current%>">
		</TD>
	</TR>
</TABLE>
</FIELDSET>
</FIELDSET>
<!-- 
<iframe frameborder="0" scrolling="auto" height="0" width="0" src="autoescalate.jsp?caseID=<%= caseID%>"></iframe>
 -->
<IFRAME name="chkUpload" frameborder="0" height="0">aa</IFRAME>
</FORM>

<!-- /div -->
<iframe height="0" id="getActionDataFrame" frameborder="0">bb</iframe>
<%if(submitSuccess.equals("")) {%>
<%@ include file="../include/eproErrorAlert.jsp"%>
<%}%>
<!-- 
<button onclick="Javascript: alert(parent.parent.frames.length)">check 1</button>
<button onclick="Javascript: alert(autoEscalateCheck())">check 2</button>
-->
</BODY>
<SCRIPT type="text/javascript">
function confirmIELeave() {
    event.returnValue = "Are you sure you want to leave Update Case page?";
}
function confirmNSLeave(iWindow) {
     if (!document.layers) return;
     if (!iWindow.closed){
     if (!confirm('Are you sure you want to leave this page?'))
            window.location.href = 'javascript:void(0)';
      }
    else window.open(location.href,'newwin');
}

     function getActionData(actValue){
          //alert(actValue);
          document.all.getActionDataFrame.src ='CFHDPC07.jsp?asel='+actValue+'&luv=<%= levelUser %>&ctype=<%= caseType%>&cRptBy=<%= reportedBy%>';
     }
     
	function showData(obj,openfirst)
	{
			var selectAction = '';
               
			if(openfirst!=''){
                         selectAction=openfirst;
                    }else{
                         selectAction=obj.options(obj.selectedIndex).value;
                    }
					  if(selectAction=='<%=CfhdCaseDetail.ACTION_ANSWER%>')
					{
					
							document.all.labelrequalifyTo.className="disableFont";
							document.all.fontrequalifyTo.className="";
							document.all.requalifyTo.disabled=true;

							
							document.all.labelchangeTo.className="disableFont";
							document.all.fontchangeTo.className="";
							document.all.changeTo.disabled=true;

							
							document.all.labeltransferTo.className="disableFont";
							document.all.fonttransferTo.className="";
							document.all.transferTo.disabled=true;	
							document.all.transferTo.value="";					
					
							document.all.labelUserLevel.className="";
							document.all.fontUserLevel.className="enableFont";
							document.all.toUserLevel.disabled=false;		
							document.all.toUserLevel.value="";	
							
							
							if ('<%=caseTypeHead%>'=='<%=CfhdCaseHead.CASE_PROBLEM_REPORT%>')
							{
								document.all.labeltypeofError.className="";
								document.all.fonttypeofError.className="enableFont";
								document.all.typeofError.disabled=false;
								document.all.typeofError.value="";	
							}else {
															document.all.labeltypeofError.className="";
															document.all.fonttypeofError.className="";
															document.all.typeofError.disabled=false;
															document.all.typeofError.value="";	
							}
                                   

                                   
					}else  if(selectAction=='<%=CfhdCaseDetail.ACTION_MANUAL_ESCALATE%>')
								{
										document.all.labelrequalifyTo.className="disableFont";
										document.all.fontrequalifyTo.className="";
										document.all.requalifyTo.disabled=true;

										document.all.labelchangeTo.className="disableFont";
										document.all.fontchangeTo.className="";
										document.all.changeTo.disabled=true;			
					
										document.all.labeltransferTo.className="disableFont";
										document.all.fonttransferTo.className="";
										document.all.transferTo.disabled=true;
										document.all.transferTo.value="";	
										
										document.all.labelUserLevel.className="";
										document.all.fontUserLevel.className="enableFont";
										document.all.toUserLevel.disabled=false;		
										document.all.toUserLevel.value="";		
										
										document.all.labeltypeofError.className="disableFont";
										document.all.fonttypeofError.className="";
										document.all.typeofError.disabled=true;		
										document.all.typeofError.value="";			
								}else if(selectAction=='<%=CfhdCaseDetail.ACTION_REJECT%>')
											{
													document.all.labelrequalifyTo.className="disableFont";
													document.all.fontrequalifyTo.className="";
													document.all.requalifyTo.disabled=true;											
											
													document.all.labelchangeTo.className="disableFont";
													document.all.fontchangeTo.className="";
													document.all.changeTo.disabled=true;
													
													document.all.labeltransferTo.className="disableFont";
													document.all.fonttransferTo.className="";
													document.all.transferTo.disabled=true;
													document.all.transferTo.value="";	
																	
													document.all.labelUserLevel.className="";
													document.all.fontUserLevel.className="enableFont";
													document.all.toUserLevel.disabled=false;		
													document.all.toUserLevel.value="";
													
													document.all.labeltypeofError.className="disableFont";
													document.all.fonttypeofError.className="";
													document.all.typeofError.disabled=true;	
													document.all.typeofError.value="";					
											}else  if(selectAction=='<%=CfhdCaseDetail.ACTION_TRANSFER%>')
														{																			
																document.all.labelrequalifyTo.className="disableFont";
																document.all.fontrequalifyTo.className="";
																document.all.requalifyTo.disabled=true;
																					
																document.all.labelchangeTo.className="disableFont";
																document.all.fontchangeTo.className="";
																document.all.changeTo.disabled=true;
														
																document.all.labeltransferTo.className="";
																document.all.fonttransferTo.className="enableFont";
																document.all.transferTo.disabled=false;			
																document.all.transferTo.value="";														
														
																document.all.labelUserLevel.className="disableFont";
																document.all.fontUserLevel.className="";
																document.all.toUserLevel.disabled=true;		
																document.all.toUserLevel.value="";				
																
																document.all.labeltypeofError.className="disableFont";
																document.all.fonttypeofError.className="";
																document.all.typeofError.disabled=true;		
																document.all.typeofError.value="";														
														}else 
                                                                            if(selectAction=='<%=CfhdCaseDetail.ACTION_REQUALIFY%>')
                                                                           {
                                                                                document.all.labelrequalifyTo.className="";
                                                                                document.all.fontrequalifyTo.className="enableFont";
                                                                                document.all.requalifyTo.disabled=false;	
                                                                                                                                                                
                                                                                document.all.labelchangeTo.className="disableFont";
                                                                                document.all.fontchangeTo.className="";
                                                                                document.all.changeTo.disabled=true;																	
                                                                           
                                                                                document.all.labeltransferTo.className="disableFont";
                                                                                document.all.fonttransferTo.className="";
                                                                                document.all.transferTo.disabled=true;
                                                                               document.all.transferTo.value="";
                                                                                                              
                                                                                document.all.labelUserLevel.className="disableFont";
                                                                                document.all.fontUserLevel.className="";
                                                                                document.all.toUserLevel.disabled=true;
                                                                                document.all.toUserLevel.value="";					
                                                                                
                                                                                document.all.labeltypeofError.className="disableFont";
                                                                                document.all.fonttypeofError.className="";
                                                                                document.all.typeofError.disabled=true;		
                                                                                document.all.typeofError.value="";																		
                                                                           }
                                                                           else if(selectAction=='<%=CfhdCaseDetail.ACTION_CHANGE_SERVERITY%>')
                                                                           {
                                                                                     document.all.labelrequalifyTo.className="disableFont";
                                                                                     document.all.fontrequalifyTo.className="";
                                                                                     document.all.requalifyTo.disabled=true;	
                                                                                                                                                                               
                                                                                     document.all.labelchangeTo.className="";
                                                                                     document.all.fontchangeTo.className="enableFont";
                                                                                     document.all.changeTo.disabled=false;
                                                                                                              
                                                                                     document.all.labeltransferTo.className="disableFont";
                                                                                     document.all.fonttransferTo.className="";
                                                                                     document.all.transferTo.disabled=true;
                                                                                     document.all.transferTo.value="";			
                                                                                                              
                                                                                     document.all.labelUserLevel.className="disableFont";
                                                                                     document.all.fontUserLevel.className="";
                                                                                     document.all.toUserLevel.disabled=true;	
                                                                                     document.all.toUserLevel.value="";					
                                                                                     
                                                                                     document.all.labeltypeofError.className="disableFont";
                                                                                     document.all.fonttypeofError.className="";
                                                                                     document.all.typeofError.disabled=true;	
                                                                                     document.all.typeofError.value="";																												
                                                                           }else  if(selectAction=='<%=CfhdCaseDetail.ACTION_APPROVE%>')
																						{
																								document.all.labelrequalifyTo.className="disableFont";
																								document.all.fontrequalifyTo.className="";
																								document.all.requalifyTo.disabled=true;
														
																								document.all.labelchangeTo.className="disableFont";
																								document.all.fontchangeTo.className="";
																								document.all.changeTo.disabled=true;			
																			
																								document.all.labeltransferTo.className="disableFont";
																								document.all.fonttransferTo.className="";
																								document.all.transferTo.disabled=true;
																								document.all.transferTo.value="";	
																								
																								document.all.labelUserLevel.className="";
																								document.all.fontUserLevel.className="enableFont";
																								updateForm.toUserLevel.options(updateForm.toUserLevel.options.selectedIndex).innerText=
																								"<%=UserLevel.getLevelName(UserLevel.LEVEL_2_COUNTRY_APPLICATION_TEAM_BACK_OFFICE)%>";	
																								updateForm.toUserLevel.disabled=true;	

																								document.all.labeltypeofError.className="disableFont";
																								document.all.fonttypeofError.className="";
																								document.all.typeofError.disabled=true;		
																								document.all.typeofError.value="";			
																						} 
                         getActionData(selectAction); //get dynamic element.
	}
    
    function checkLargeValue(){
    	if(updateForm.detail.value.length<1000){ 
			
			if(updateForm.description.value.length<1000){		
				return true;
			}else{
						showOWarningDialog("Data too large for column", "<B>Description</B> must less than 1000 character", "OK.") ;
						return false;
					}
		}else{
					showOWarningDialog("Data too large for column", "<B>Detail</B> must less than 1000 character", "OK.") ;
					return false;
			}
    }
    
    

		function submitForm()
	{
		if('<%=reportedBy%>'!=''){ 
				if(updateForm.rptBy.value=='L3ZDC'&&updateForm.DWNumber.value==''){
					showOWarningDialog("Data not complete", "Please enter : <B>DW Number</B>", "OK.") ;
					return false;
				}
		}
		if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_ANSWER%>')
		{
			if ('<%=caseTypeHead%>'=='<%=CfhdCaseHead.CASE_PROBLEM_REPORT%>'){
						if(/* isNull(updateForm.system,"System")
						&&isNull(updateForm.module,"Module")
						&&isNull(updateForm.aldataNo,"Aldata Internal No.")
						&&isNull(updateForm.goldVersion,"GOLD Version")
						&&isNull(updateForm.environment,"Environment")
						&&isNull(updateForm.screenName,"Screen Name")
						&&*/isNull(updateForm.toUserLevel,"To User Level")
						&&isNull(updateForm.typeofError,"Type of Error")
						)
						{ if(checkLargeValue()){
														if(showOConfirmDialog("update case", "Do you want to submit data?", "OK.", "Cancel") == 1)
														{
                                                                                     updateForm.action.value='submit';
                                                                                     programLayer.style.visibility='hidden';
                                                                                     processingLayer.style.visibility='visible';
                                                                                     updateForm.submit();
														}
						 }
						}
			}else{
						if(/* isNull(updateForm.system,"System")
						&&isNull(updateForm.module,"Module")
						&&isNull(updateForm.aldataNo,"Aldata Internal No.")
						&&isNull(updateForm.goldVersion,"GOLD Version")
						&&isNull(updateForm.environment,"Environment")
						&&isNull(updateForm.screenName,"Screen Name")
						&&*/isNull(updateForm.toUserLevel,"To User Level")
						//&&isNull(updateForm.typeofError,"Type of Error")
						)
						{ if(checkLargeValue()){
														if(showOConfirmDialog("update case", "Do you want to submit data?", "OK.", "Cancel") == 1)
														{
                                                                                     updateForm.action.value='submit';
                                                                                     programLayer.style.visibility='hidden';
                                                                                     processingLayer.style.visibility='visible';
                                                                                     updateForm.submit();
														}
						   }					
						}
			
			}
		}else
						if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_MANUAL_ESCALATE%>')
						{
										if( /*isNull(updateForm.system,"System")
										&&isNull(updateForm.module,"Module")
										&&isNull(updateForm.aldataNo,"Aldata Internal No.")
										&&isNull(updateForm.goldVersion,"GOLD Version")
										&&isNull(updateForm.environment,"Environment")
										&&isNull(updateForm.screenName,"Screen Name")
										&&*/isNull(updateForm.toUserLevel,"To User Level")
										)
										{ if(checkLargeValue()){
														if(showOConfirmDialog("update case", "Do you want to submit data?", "OK.", "Cancel") == 1)
														{
                                                                                updateForm.action.value='submit';
                                                                                programLayer.style.visibility='hidden';
                                                                                processingLayer.style.visibility='visible';
                                                                                updateForm.submit();
														}
											}
										}
						}else
												if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_REJECT%>')
												{
																if( /*isNull(updateForm.system,"System")
																&&isNull(updateForm.module,"Module")
																&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																&&isNull(updateForm.goldVersion,"GOLD Version")
																&&isNull(updateForm.environment,"Environment")
																&&isNull(updateForm.screenName,"Screen Name")
																&&*/isNull(updateForm.toUserLevel,"To User Level")
																)
																{ if(checkLargeValue()){
																			if(showOConfirmDialog("update case", "Do you want to submit data?", "OK.", "Cancel") == 1)
																			{		
                                                                                                    updateForm.action.value='submit';
                                                                                                    programLayer.style.visibility='hidden';
                                                                                                    processingLayer.style.visibility='visible';
                                                                                                    updateForm.submit();
																			}
															      }
																}
												}else
																if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_TRANSFER%>')
																{
																				if(/* isNull(updateForm.system,"System")
																				&&isNull(updateForm.module,"Module")
																				&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																				&&isNull(updateForm.goldVersion,"GOLD Version")
																				&&isNull(updateForm.environment,"Environment")
																				&&isNull(updateForm.screenName,"Screen Name")
																				&&*/isNull(updateForm.transferTo,"Transfer")
																				)
																				{ if(checkLargeValue()){
																								if(showOConfirmDialog("update case", "Do you want to submit data?", "OK.", "Cancel") == 1)
																								{				
                                                                                                                                       updateForm.action.value='submit';
                                                                                                                                        programLayer.style.visibility='hidden';
                                                                                                                                       processingLayer.style.visibility='visible';                                                                                                                                 
																				                                   updateForm.submit();
																								}
																					}
																				}
																}else
																				if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_REQUALIFY%>')
																				{
																								if(/* isNull(updateForm.system,"System")
																								&&isNull(updateForm.module,"Module")
																								&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																								&&isNull(updateForm.goldVersion,"GOLD Version")
																								&&isNull(updateForm.environment,"Environment")
																								&&isNull(updateForm.screenName,"Screen Name")
																								&&*/isNull(updateForm.requalifyTo,"Requalify Type To")
																								)
																								{ if(checkLargeValue()){
																															if(showOConfirmDialog("update case", "Do you want to submit data?", "OK.", "Cancel") == 1)
																															{		
																											                              updateForm.action.value='submit';
				                                                                                                                                                 programLayer.style.visibility='hidden';
				                                                                                                                                                 processingLayer.style.visibility='visible';
				                                                                                                                                                 updateForm.submit();
																															}
																									}
																								}
																				}else
																									if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_CHANGE_SERVERITY%>')
																									{
																													if( /*isNull(updateForm.system,"System")
																													&&isNull(updateForm.module,"Module")
																													&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																													&&isNull(updateForm.goldVersion,"GOLD Version")
																													&&isNull(updateForm.environment,"Environment")
																													&&isNull(updateForm.screenName,"Screen Name")
																													&&*/isNull(updateForm.changeTo,"Change Severity To")
																													)
																													{ if(checkLargeValue()){
																																				if(showOConfirmDialog("update case", "Do you want to submit data?", "OK.", "Cancel") == 1)
																																				{		
																																                              updateForm.action.value='submit';
									                                                                                                                                                 programLayer.style.visibility='hidden';
									                                                                                                                                                 processingLayer.style.visibility='visible';
									                                                                                                                                                 updateForm.submit();
																																				}
																														}
																													}
																									}else
																														if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_APPROVE%>')
																														{
																														/* if( isNull(updateForm.system,"System")
																																&&isNull(updateForm.module,"Module")
																																&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																																&&isNull(updateForm.goldVersion,"GOLD Version")
																																&&isNull(updateForm.environment,"Environment")
																																&&isNull(updateForm.screenName,"Screen Name")
																															 )
																															 {*/ if(checkLargeValue()){
																																									if(showOConfirmDialog("update case", "Do you want to submit data?", "OK.", "Cancel") == 1)
																																									{		
																																					                              updateForm.action.value='submit';
														                                                                                                                                                 programLayer.style.visibility='hidden';
														                                                                                                                                                 processingLayer.style.visibility='visible';
														                                                                                                                                                 updateForm.submit();
																																									}
																																	}
																																//}
																														}
						
						
	}

	function saveForm()
	{
		if('<%=reportedBy%>'!=''){ 
				if(updateForm.rptBy.value=='L3ZDC'&&updateForm.DWNumber.value==''){
					showOWarningDialog("Data not complete", "Please enter : <B>DW Number</B>", "OK.") ;
					return false;
				}
		}
		if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_ANSWER%>')
		{
		
				if ('<%=caseTypeHead%>'=='<%=CfhdCaseHead.CASE_PROBLEM_REPORT%>'){
						if(/* isNull(updateForm.system,"System")
						&&isNull(updateForm.module,"Module")
						&&isNull(updateForm.aldataNo,"Aldata Internal No.")
						&&isNull(updateForm.goldVersion,"GOLD Version")
						&&isNull(updateForm.environment,"Environment")
						&&isNull(updateForm.screenName,"Screen Name")
						&&*/isNull(updateForm.toUserLevel,"To User Level")
						&&isNull(updateForm.typeofError,"Type of Error")
						)
						{         if(checkLargeValue()){
													if(showOConfirmDialog("update case", "Do you want to save data?", "OK.", "Cancel") == 1)
													{		

                                                                                     updateForm.action.value='save';
                                                                                     programLayer.style.visibility='hidden';
                                                                                     processingLayer.style.visibility='visible';
									                                        updateForm.submit();
													}
								 }
						}
				}else{
				
										if(/* isNull(updateForm.system,"System")
						&&isNull(updateForm.module,"Module")
						&&isNull(updateForm.aldataNo,"Aldata Internal No.")
						&&isNull(updateForm.goldVersion,"GOLD Version")
						&&isNull(updateForm.environment,"Environment")
						&&isNull(updateForm.screenName,"Screen Name")
						&&*/isNull(updateForm.toUserLevel,"To User Level")
						//&&isNull(updateForm.typeofError,"Type of Error")
						)
						{ if(checkLargeValue()){
													if(showOConfirmDialog("update case", "Do you want to save data?", "OK.", "Cancel") == 1)
													{		

                                                                                     updateForm.action.value='save';
                                                                                     programLayer.style.visibility='hidden';
                                                                                     processingLayer.style.visibility='visible';
									                                        updateForm.submit();
													}
						 }
						}
				
				}
		}else
						if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_MANUAL_ESCALATE%>')
						{
										if( /*isNull(updateForm.system,"System")
										&&isNull(updateForm.module,"Module")
										&&isNull(updateForm.aldataNo,"Aldata Internal No.")
										&&isNull(updateForm.goldVersion,"GOLD Version")
										&&isNull(updateForm.environment,"Environment")
										&&isNull(updateForm.screenName,"Screen Name")
										&&*/isNull(updateForm.toUserLevel,"To User Level")
										)
										{ if(checkLargeValue()){
																	if(showOConfirmDialog("update case", "Do you want to save data?", "OK.", "Cancel") == 1)
																	{		
                                                                                               updateForm.action.value='save';
                                                                                               programLayer.style.visibility='hidden';
                                                                                               processingLayer.style.visibility='visible';
                                                                                               updateForm.submit();
																	}
											}
										}
						}else
												if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_REJECT%>')
												{
																if(/* isNull(updateForm.system,"System")
																&&isNull(updateForm.module,"Module")
																&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																&&isNull(updateForm.goldVersion,"GOLD Version")
																&&isNull(updateForm.environment,"Environment")
																&&isNull(updateForm.screenName,"Screen Name")
																&&*/isNull(updateForm.toUserLevel,"To User Level")
																)
																{ if(checkLargeValue()){
																							if(showOConfirmDialog("update case", "Do you want to save data?", "OK.", "Cancel") == 1)
																							{		
                                                                                                                             updateForm.action.value='save';
                                                                                                                             programLayer.style.visibility='hidden';
                                                                                                                             processingLayer.style.visibility='visible';
                                                                                                                             updateForm.submit();
																							}
																	}
																}
												}else
																if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_TRANSFER%>')
																{
																				if(/* isNull(updateForm.system,"System")
																				&&isNull(updateForm.module,"Module")
																				&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																				&&isNull(updateForm.goldVersion,"GOLD Version")
																				&&isNull(updateForm.environment,"Environment")
																				&&isNull(updateForm.screenName,"Screen Name")
																				&&*/isNull(updateForm.transferTo,"Transfer")
																				)
																				{ if(checkLargeValue()){
																											if(showOConfirmDialog("update case", "Do you want to save data?", "OK.", "Cancel") == 1)
																											{		
																							                              updateForm.action.value='save';
                                                                                                                                                 programLayer.style.visibility='hidden';
                                                                                                                                                 processingLayer.style.visibility='visible';
                                                                                                                                                 updateForm.submit();
																											}
																					}
																				}
																}else
																				if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_REQUALIFY%>')
																				{
																								if(/* isNull(updateForm.system,"System")
																								&&isNull(updateForm.module,"Module")
																								&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																								&&isNull(updateForm.goldVersion,"GOLD Version")
																								&&isNull(updateForm.environment,"Environment")
																								&&isNull(updateForm.screenName,"Screen Name")
																								&&*/isNull(updateForm.requalifyTo,"Requalify Type To")
																								)
																								{ if(checkLargeValue()){
																															if(showOConfirmDialog("update case", "Do you want to save data?", "OK.", "Cancel") == 1)
																															{		
																											                              updateForm.action.value='save';
				                                                                                                                                                 programLayer.style.visibility='hidden';
				                                                                                                                                                 processingLayer.style.visibility='visible';
				                                                                                                                                                 updateForm.submit();
																															}
																									}
																								}
																				}else
																									if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_CHANGE_SERVERITY%>')
																									{
																													if(/* isNull(updateForm.system,"System")
																													&&isNull(updateForm.module,"Module")
																													&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																													&&isNull(updateForm.goldVersion,"GOLD Version")
																													&&isNull(updateForm.environment,"Environment")
																													&&isNull(updateForm.screenName,"Screen Name")
																													&&*/isNull(updateForm.changeTo,"Change Severity To")
																													)
																													{ if(checkLargeValue()){
																																				if(showOConfirmDialog("update case", "Do you want to save data?", "OK.", "Cancel") == 1)
																																				{		
																																                              updateForm.action.value='save';
									                                                                                                                                                 programLayer.style.visibility='hidden';
									                                                                                                                                                 processingLayer.style.visibility='visible';
									                                                                                                                                                 updateForm.submit();
																																				}
																														}
																													}
																									}else
																													if(updateForm.selectAction.value=='<%=CfhdCaseDetail.ACTION_APPROVE%>')
																													{
																																/*if( isNull(updateForm.system,"System")
																																	&&isNull(updateForm.module,"Module")
																																	&&isNull(updateForm.aldataNo,"Aldata Internal No.")
																																	&&isNull(updateForm.goldVersion,"GOLD Version")
																																	&&isNull(updateForm.environment,"Environment")
																																	&&isNull(updateForm.screenName,"Screen Name")
																																)		
																																{*/    if(checkLargeValue()){
																																								if(showOConfirmDialog("update case", "Do you want to save data?", "OK.", "Cancel") == 1)
																																								{		
																																				                              updateForm.action.value='save';
													                                                                                                                                                 programLayer.style.visibility='hidden';
													                                                                                                                                                 processingLayer.style.visibility='visible';
													                                                                                                                                                 updateForm.submit();
																																								}
																																		}
																																//}
																													}
						
	}
	
	function limitModule()
	{
			var sysNow	=	updateForm.system.value;
			var whole			=	new Array(<%=wholeModule%>);
			var oldData	=	'<%=module%>';
			//alert('<%//=module%>');
			var	len				=	updateForm.module.length;
			
		if(sysNow=='GOLD')
		{
					//document.all.fontAldataNo.className="enableFont";
					document.all.fontGoldVersion.className="enableFont";
					document.all.fontEnvironment.className="enableFont";
		}else{
					//document.all.fontAldataNo.className="";
					document.all.fontGoldVersion.className="";
					document.all.fontEnvironment.className="";
					}
		

			// remove all from SELECT
			for (var k=len;k<=(len)&&(k>=0);k--)
			{
					updateForm.module.remove(k);
			}// end for remove data
					
			if (sysNow=="")
			{
					var module0	=	document.createElement("OPTION");
					module0.text		=	"- - Please select - -";
					module0.value	=	"";
					updateForm.module.add(module0);
			}else{
					// add data to SELECT
					for (var m=0;m<whole.length;m++)
					{
							if (whole[m].search(sysNow) != -1)
							{
									var	myRegExp	=	" - ";
									var	temp				=	whole[m].substring(0,whole[m].search(myRegExp));
									eval('var module'+m+'	=	document.createElement("OPTION")');
									eval('module'+m+'.text	=	temp');
									eval('module'+m+'.value=	temp'); 
									
									if(temp==oldData)
										{
										//alert(oldData);
											eval('module'+m+'.selected=	true');
										}
									eval('updateForm.module.add(module'+m+')');

							}

					}// end for add data

			} // end if system not null

	}


	function showDataFirst(obj,openfirst)
	{
			var selectAction = '';
               
			if(openfirst!=''){
                         selectAction=openfirst;
                    }else{
                         selectAction=obj.options(obj.selectedIndex).value;
                    }
					  if(selectAction=='<%=CfhdCaseDetail.ACTION_ANSWER%>')
					{
					
							document.all.labelrequalifyTo.className="disableFont";
							document.all.fontrequalifyTo.className="";
							document.all.requalifyTo.disabled=true;

							
							document.all.labelchangeTo.className="disableFont";
							document.all.fontchangeTo.className="";
							document.all.changeTo.disabled=true;

							
							document.all.labeltransferTo.className="disableFont";
							document.all.fonttransferTo.className="";
							document.all.transferTo.disabled=true;	
							//document.all.transferTo.value="";					
					
							document.all.labelUserLevel.className="";
							document.all.fontUserLevel.className="enableFont";
							document.all.toUserLevel.disabled=false;		
							//document.all.toUserLevel.value="";	
							

							if ('<%=caseTypeHead%>'=='<%=CfhdCaseHead.CASE_PROBLEM_REPORT%>')
							{
								document.all.labeltypeofError.className="";
								document.all.fonttypeofError.className="enableFont";
								document.all.typeofError.disabled=false;
								//document.all.typeofError.value="";	
							}else {
															document.all.labeltypeofError.className="";
															document.all.fonttypeofError.className="";
															document.all.typeofError.disabled=false;
															//document.all.typeofError.value="";	
							}
							//*document.all.labeltypeofError.className="";
							//*document.all.fonttypeofError.className="enableFont";
							//*document.all.typeofError.disabled=false;
							//document.all.typeofError.value="";	
                                   

                                   
					}else  if(selectAction=='<%=CfhdCaseDetail.ACTION_MANUAL_ESCALATE%>')
								{
										document.all.labelrequalifyTo.className="disableFont";
										document.all.fontrequalifyTo.className="";
										document.all.requalifyTo.disabled=true;

										document.all.labelchangeTo.className="disableFont";
										document.all.fontchangeTo.className="";
										document.all.changeTo.disabled=true;			
					
										document.all.labeltransferTo.className="disableFont";
										document.all.fonttransferTo.className="";
										document.all.transferTo.disabled=true;
										//document.all.transferTo.value="";	
										
										document.all.labelUserLevel.className="";
										document.all.fontUserLevel.className="enableFont";
										document.all.toUserLevel.disabled=false;		
										//document.all.toUserLevel.value="";		
										
										document.all.labeltypeofError.className="disableFont";
										document.all.fonttypeofError.className="";
										document.all.typeofError.disabled=true;		
										//document.all.typeofError.value="";			
								}else if(selectAction=='<%=CfhdCaseDetail.ACTION_REJECT%>')
											{
													document.all.labelrequalifyTo.className="disableFont";
													document.all.fontrequalifyTo.className="";
													document.all.requalifyTo.disabled=true;											
											
													document.all.labelchangeTo.className="disableFont";
													document.all.fontchangeTo.className="";
													document.all.changeTo.disabled=true;
													
													document.all.labeltransferTo.className="disableFont";
													document.all.fonttransferTo.className="";
													document.all.transferTo.disabled=true;
													//document.all.transferTo.value="";	
																	
													document.all.labelUserLevel.className="";
													document.all.fontUserLevel.className="enableFont";
													document.all.toUserLevel.disabled=false;		
													//document.all.toUserLevel.value="";
													
													document.all.labeltypeofError.className="disableFont";
													document.all.fonttypeofError.className="";
													document.all.typeofError.disabled=true;	
													//document.all.typeofError.value="";					
											}else  if(selectAction=='<%=CfhdCaseDetail.ACTION_TRANSFER%>')
														{																			
																document.all.labelrequalifyTo.className="disableFont";
																document.all.fontrequalifyTo.className="";
																document.all.requalifyTo.disabled=true;
																					
																document.all.labelchangeTo.className="disableFont";
																document.all.fontchangeTo.className="";
																document.all.changeTo.disabled=true;
														
																document.all.labeltransferTo.className="";
																document.all.fonttransferTo.className="enableFont";
																document.all.transferTo.disabled=false;			
																//document.all.transferTo.value="";														
														
																document.all.labelUserLevel.className="disableFont";
																document.all.fontUserLevel.className="";
																document.all.toUserLevel.disabled=true;		
																//document.all.toUserLevel.value="";				
																
																document.all.labeltypeofError.className="disableFont";
																document.all.fonttypeofError.className="";
																document.all.typeofError.disabled=true;		
																//document.all.typeofError.value="";														
														}else 
                                                                            if(selectAction=='<%=CfhdCaseDetail.ACTION_REQUALIFY%>')
                                                                           {
                                                                                document.all.labelrequalifyTo.className="";
                                                                                document.all.fontrequalifyTo.className="enableFont";
                                                                                document.all.requalifyTo.disabled=false;	
                                                                                                                                                                
                                                                                document.all.labelchangeTo.className="disableFont";
                                                                                document.all.fontchangeTo.className="";
                                                                                document.all.changeTo.disabled=true;																	
                                                                           
                                                                                document.all.labeltransferTo.className="disableFont";
                                                                                document.all.fonttransferTo.className="";
                                                                                document.all.transferTo.disabled=true;
                                                                               //document.all.transferTo.value="";
                                                                                                              
                                                                                document.all.labelUserLevel.className="disableFont";
                                                                                document.all.fontUserLevel.className="";
                                                                                document.all.toUserLevel.disabled=true;
                                                                                //document.all.toUserLevel.value="";					
                                                                                
                                                                                document.all.labeltypeofError.className="disableFont";
                                                                                document.all.fonttypeofError.className="";
                                                                                document.all.typeofError.disabled=true;		
                                                                                //document.all.typeofError.value="";																		
                                                                           }
                                                                           else if(selectAction=='<%=CfhdCaseDetail.ACTION_CHANGE_SERVERITY%>')
                                                                           {
                                                                                     document.all.labelrequalifyTo.className="disableFont";
                                                                                     document.all.fontrequalifyTo.className="";
                                                                                     document.all.requalifyTo.disabled=true;	
                                                                                                                                                                               
                                                                                     document.all.labelchangeTo.className="";
                                                                                     document.all.fontchangeTo.className="enableFont";
                                                                                     document.all.changeTo.disabled=false;
                                                                                                              
                                                                                     document.all.labeltransferTo.className="disableFont";
                                                                                     document.all.fonttransferTo.className="";
                                                                                     document.all.transferTo.disabled=true;
                                                                                     //document.all.transferTo.value="";			
                                                                                                              
                                                                                     document.all.labelUserLevel.className="disableFont";
                                                                                     document.all.fontUserLevel.className="";
                                                                                     document.all.toUserLevel.disabled=true;	
                                                                                     //document.all.toUserLevel.value="";					
                                                                                     
                                                                                     document.all.labeltypeofError.className="disableFont";
                                                                                     document.all.fonttypeofError.className="";
                                                                                     document.all.typeofError.disabled=true;	
                                                                                     //document.all.typeofError.value="";																												
                                                                           }else  if(selectAction=='<%=CfhdCaseDetail.ACTION_APPROVE%>')
																						{
																								document.all.labelrequalifyTo.className="disableFont";
																								document.all.fontrequalifyTo.className="";
																								document.all.requalifyTo.disabled=true;
														
																								document.all.labelchangeTo.className="disableFont";
																								document.all.fontchangeTo.className="";
																								document.all.changeTo.disabled=true;			
																			
																								document.all.labeltransferTo.className="disableFont";
																								document.all.fonttransferTo.className="";
																								document.all.transferTo.disabled=true;
																								//document.all.transferTo.value="";	
																								
																								document.all.labelUserLevel.className="";
																								document.all.fontUserLevel.className="enableFont";
																								document.all.toUserLevel.disabled=true;		
																								//document.all.toUserLevel.value="";		
																								
																								document.all.labeltypeofError.className="disableFont";
																								document.all.fonttypeofError.className="";
																								document.all.typeofError.disabled=true;		
																								//document.all.typeofError.value="";			
																						} 
                                                                           
                         //getActionData(selectAction); //get dynamic element.
	}
	function checkExts(check){
               if(autoEscalateCheck()){
                         name	=	updateForm.fileName.value;
                         exts		=	name.substring((name.lastIndexOf('.'))+1);
                         if (exts.toLowerCase().indexOf('bat') != -1 || exts.toLowerCase().indexOf('com') != -1 || 
                              exts.toLowerCase().indexOf('exe') != -1 || exts.toLowerCase().indexOf('cmd') != -1 || 
                              exts.toLowerCase().indexOf('js') != -1)
                         {		
                              showOWarningDialog("warning","<B>Invalid file.<BR><T>Executable file is not permitted. Please try again.","OK");	
                         }
                         else
                         {		if(check=="submit")	{submitForm();}
                                   if(check=="save")	{saveForm();}	
                         }
               }else{
                    showOInfoDialog("Case Escalated!!","Case was automatically escalated. \n Please close this window after press OK button.","OK");
               }
	}

     function autoEscalateCheck(){
//          alert(dialogArguments.all.checkUnload.value);
          if(dialogArguments.all.checkUnload.value=='autoescalted'){
               return false; //if case escalated it 'll return false to do not allow submit or save.
          }else{
               return true;
          }
     }

	function showProgramLayer(){
			parent.programLayer.style.visibility='visible';
			parent.processingLayer.style.visibility='hidden';
	}
	
	function requireField(check){
	var sysNow	=	updateForm.system.value;
		if(sysNow=='GOLD')
		{
			if( isNull(updateForm.system,"System")
			&&isNull(updateForm.module,"Module")
			//&&isNull(updateForm.aldataNo,"Aldata Internal No.")
			&&isNull(updateForm.goldVersion,"GOLD Version")
			&&isNull(updateForm.environment,"Environment"))
			{
					checkExts(check);
			}
		}else{
							if( isNull(updateForm.system,"System")
							&&isNull(updateForm.module,"Module"))
							{
									checkExts(check);
							}
					}
	
	}
</SCRIPT>
</HTML>
